import java.util.Scanner;

public class demo03 {
    public static void main(String[] args) {
        int[] arr = new int[6];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i+1) + "位评委的评分：");
            arr[i] = scanner.nextInt();
            if (arr[i] < 0 || arr[i] > 100) {
                System.out.println("评分错误：");
            }
        }
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j+1]) {
                    int a = arr[i];
                    arr[i] = arr[j+1];
                    arr[j+1] = a;
                }
            }
        }
        int score = (arr[1] + arr[2] + arr[3] + arr[4]) / 4;
        System.out.println("最终评分为：" + score);
    }
}
